const errorImg = "https://img1.baidu.com/it/u=3477470254,523159555&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
const errimage = {
  created(el, binding, vnode, prevVnode) {
  console.log(111)

    console.log(el, binding, vnode, prevVnode)
    const src = binding.value
    if(!src) {
      el.setAttribute('src', errorImg)
    }
    const img = new Image()
    img.src = src
    img.onload = () => {
      el.setAttribute('src', src)
    }
    img.onerror = () => {
      el.setAttribute('src', errorImg)
    }
  }
}
export default errimage